package com.example.blank700.activityandintent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class otherActivity extends Activity{
    private Intent intent;
    private Bundle bundle;

    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_other);
        Bundle bundle=this.getIntent().getExtras();
        String ans=bundle.getString("ans");
        String sexText="";
        if(ans.equals("in")){
            sexText="正确";
        }
        else{
            sexText="错误";
        }
        TextView tvl=(TextView)findViewById(R.id.text1);
        tvl.setText("你选择的答案是："+sexText);

        Button btn3_back=(Button)findViewById(R.id.button_back);
        btn3_back.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v){
                otherActivity.this.setResult(RESULT_OK,intent);
                otherActivity.this.finish();
            }
        });
    }
}
